\(\int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx\) [273]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [F]
   Maxima [F]
   Giac [F]
   Mupad [F(-1)]

Optimal result

Integrand size = 27, antiderivative size = 161 \[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {(e+f x) \arctan \left (e^{c+d x}\right )}{a d}-\frac {i f \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{2 a d^2}+\frac {i f \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{2 a d^2}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d} \]

[Out]

(f*x+e)*arctan(exp(d*x+c))/a/d-1/2*I*f*polylog(2,-I*exp(d*x+c))/a/d^2+1/2*I*f*polylog(2,I*exp(d*x+c))/a/d^2+1/
2*f*sech(d*x+c)/a/d^2+1/2*I*(f*x+e)*sech(d*x+c)^2/a/d-1/2*I*f*tanh(d*x+c)/a/d^2+1/2*(f*x+e)*sech(d*x+c)*tanh(d
*x+c)/a/d

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 161, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.296, Rules used = {5690, 4270, 4265, 2317, 2438, 5559, 3852, 8} \[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {(e+f x) \arctan \left (e^{c+d x}\right )}{a d}-\frac {i f \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{2 a d^2}+\frac {i f \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{2 a d^2}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x) \tanh (c+d x) \text {sech}(c+d x)}{2 a d} \]

[In]

Int[((e + f*x)*Sech[c + d*x])/(a + I*a*Sinh[c + d*x]),x]

[Out]

((e + f*x)*ArcTan[E^(c + d*x)])/(a*d) - ((I/2)*f*PolyLog[2, (-I)*E^(c + d*x)])/(a*d^2) + ((I/2)*f*PolyLog[2, I
*E^(c + d*x)])/(a*d^2) + (f*Sech[c + d*x])/(2*a*d^2) + ((I/2)*(e + f*x)*Sech[c + d*x]^2)/(a*d) - ((I/2)*f*Tanh
[c + d*x])/(a*d^2) + ((e + f*x)*Sech[c + d*x]*Tanh[c + d*x])/(2*a*d)

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3852

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> Dist[-d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 4265

Int[csc[(e_.) + Pi*(k_.) + (Complex[0, fz_])*(f_.)*(x_)]*((c_.) + (d_.)*(x_))^(m_.), x_Symbol] :> Simp[-2*(c +
 d*x)^m*(ArcTanh[E^((-I)*e + f*fz*x)/E^(I*k*Pi)]/(f*fz*I)), x] + (-Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*
Log[1 - E^((-I)*e + f*fz*x)/E^(I*k*Pi)], x], x] + Dist[d*(m/(f*fz*I)), Int[(c + d*x)^(m - 1)*Log[1 + E^((-I)*e
 + f*fz*x)/E^(I*k*Pi)], x], x]) /; FreeQ[{c, d, e, f, fz}, x] && IntegerQ[2*k] && IGtQ[m, 0]

Rule 4270

Int[(csc[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[(-b^2)*(c + d*x)*Cot[e + f*x]
*((b*Csc[e + f*x])^(n - 2)/(f*(n - 1))), x] + (Dist[b^2*((n - 2)/(n - 1)), Int[(c + d*x)*(b*Csc[e + f*x])^(n -
 2), x], x] - Simp[b^2*d*((b*Csc[e + f*x])^(n - 2)/(f^2*(n - 1)*(n - 2))), x]) /; FreeQ[{b, c, d, e, f}, x] &&
 GtQ[n, 1] && NeQ[n, 2]

Rule 5559

Int[((c_.) + (d_.)*(x_))^(m_.)*Sech[(a_.) + (b_.)*(x_)]^(n_.)*Tanh[(a_.) + (b_.)*(x_)]^(p_.), x_Symbol] :> Sim
p[(-(c + d*x)^m)*(Sech[a + b*x]^n/(b*n)), x] + Dist[d*(m/(b*n)), Int[(c + d*x)^(m - 1)*Sech[a + b*x]^n, x], x]
 /; FreeQ[{a, b, c, d, n}, x] && EqQ[p, 1] && GtQ[m, 0]

Rule 5690

Int[(((e_.) + (f_.)*(x_))^(m_.)*Sech[(c_.) + (d_.)*(x_)]^(n_.))/((a_) + (b_.)*Sinh[(c_.) + (d_.)*(x_)]), x_Sym
bol] :> Dist[1/a, Int[(e + f*x)^m*Sech[c + d*x]^(n + 2), x], x] + Dist[1/b, Int[(e + f*x)^m*Sech[c + d*x]^(n +
 1)*Tanh[c + d*x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && IGtQ[m, 0] && EqQ[a^2 + b^2, 0]

Rubi steps \begin{align*} \text {integral}& = -\frac {i \int (e+f x) \text {sech}^2(c+d x) \tanh (c+d x) \, dx}{a}+\frac {\int (e+f x) \text {sech}^3(c+d x) \, dx}{a} \\ & = \frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {\int (e+f x) \text {sech}(c+d x) \, dx}{2 a}-\frac {(i f) \int \text {sech}^2(c+d x) \, dx}{2 a d} \\ & = \frac {(e+f x) \arctan \left (e^{c+d x}\right )}{a d}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}+\frac {f \text {Subst}(\int 1 \, dx,x,-i \tanh (c+d x))}{2 a d^2}-\frac {(i f) \int \log \left (1-i e^{c+d x}\right ) \, dx}{2 a d}+\frac {(i f) \int \log \left (1+i e^{c+d x}\right ) \, dx}{2 a d} \\ & = \frac {(e+f x) \arctan \left (e^{c+d x}\right )}{a d}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d}-\frac {(i f) \text {Subst}\left (\int \frac {\log (1-i x)}{x} \, dx,x,e^{c+d x}\right )}{2 a d^2}+\frac {(i f) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{c+d x}\right )}{2 a d^2} \\ & = \frac {(e+f x) \arctan \left (e^{c+d x}\right )}{a d}-\frac {i f \operatorname {PolyLog}\left (2,-i e^{c+d x}\right )}{2 a d^2}+\frac {i f \operatorname {PolyLog}\left (2,i e^{c+d x}\right )}{2 a d^2}+\frac {f \text {sech}(c+d x)}{2 a d^2}+\frac {i (e+f x) \text {sech}^2(c+d x)}{2 a d}-\frac {i f \tanh (c+d x)}{2 a d^2}+\frac {(e+f x) \text {sech}(c+d x) \tanh (c+d x)}{2 a d} \\ \end{align*}

Mathematica [B] (verified)

Both result and optimal contain complex but leaf count is larger than twice the leaf count of optimal. \(400\) vs. \(2(161)=322\).

Time = 2.24 (sec) , antiderivative size = 400, normalized size of antiderivative = 2.48 \[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=-\frac {-2 i d (e+f x)+(c+d x) (c f-d (2 e+f x)) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2+(1-i) \left (\frac {1}{2} d^2 f x^2+d e (c+d x)-(1-i) (d e-c f) (c+d x)+(1-i) f (c+d x) \log \left (1+i e^{-c-d x}\right )+(1-i) (d e-c f) \log \left (i+e^{c+d x}\right )-(1-i) f \operatorname {PolyLog}\left (2,-i e^{-c-d x}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2+(1+i) \left (\frac {1}{2} d^2 f x^2+d e (c+d x)-(1+i) (d e-c f) (c+d x)+(1+i) f (c+d x) \log \left (1-i e^{-c-d x}\right )+(1+i) (d e-c f) \log \left (i-e^{c+d x}\right )-(1+i) f \operatorname {PolyLog}\left (2,i e^{-c-d x}\right )\right ) \left (\cosh \left (\frac {1}{2} (c+d x)\right )+i \sinh \left (\frac {1}{2} (c+d x)\right )\right )^2-4 f \sinh \left (\frac {1}{2} (c+d x)\right ) \left (-i \cosh \left (\frac {1}{2} (c+d x)\right )+\sinh \left (\frac {1}{2} (c+d x)\right )\right )}{4 d^2 (a+i a \sinh (c+d x))} \]

[In]

Integrate[((e + f*x)*Sech[c + d*x])/(a + I*a*Sinh[c + d*x]),x]

[Out]

-1/4*((-2*I)*d*(e + f*x) + (c + d*x)*(c*f - d*(2*e + f*x))*(Cosh[(c + d*x)/2] + I*Sinh[(c + d*x)/2])^2 + (1 -
I)*((d^2*f*x^2)/2 + d*e*(c + d*x) - (1 - I)*(d*e - c*f)*(c + d*x) + (1 - I)*f*(c + d*x)*Log[1 + I*E^(-c - d*x)
] + (1 - I)*(d*e - c*f)*Log[I + E^(c + d*x)] - (1 - I)*f*PolyLog[2, (-I)*E^(-c - d*x)])*(Cosh[(c + d*x)/2] + I
*Sinh[(c + d*x)/2])^2 + (1 + I)*((d^2*f*x^2)/2 + d*e*(c + d*x) - (1 + I)*(d*e - c*f)*(c + d*x) + (1 + I)*f*(c
+ d*x)*Log[1 - I*E^(-c - d*x)] + (1 + I)*(d*e - c*f)*Log[I - E^(c + d*x)] - (1 + I)*f*PolyLog[2, I*E^(-c - d*x
)])*(Cosh[(c + d*x)/2] + I*Sinh[(c + d*x)/2])^2 - 4*f*Sinh[(c + d*x)/2]*((-I)*Cosh[(c + d*x)/2] + Sinh[(c + d*
x)/2]))/(d^2*(a + I*a*Sinh[c + d*x]))

Maple [A] (verified)

Time = 5.38 (sec) , antiderivative size = 218, normalized size of antiderivative = 1.35

method result size
risch \(\frac {d f x \,{\mathrm e}^{d x +c}+d e \,{\mathrm e}^{d x +c}+f \,{\mathrm e}^{d x +c}-i f}{\left ({\mathrm e}^{d x +c}-i\right )^{2} d^{2} a}+\frac {e \arctan \left ({\mathrm e}^{d x +c}\right )}{d a}+\frac {i f \ln \left (1-i {\mathrm e}^{d x +c}\right ) x}{2 d a}+\frac {i f \ln \left (1-i {\mathrm e}^{d x +c}\right ) c}{2 d^{2} a}+\frac {i f \operatorname {polylog}\left (2, i {\mathrm e}^{d x +c}\right )}{2 a \,d^{2}}-\frac {i f \ln \left (1+i {\mathrm e}^{d x +c}\right ) x}{2 d a}-\frac {i f \ln \left (1+i {\mathrm e}^{d x +c}\right ) c}{2 d^{2} a}-\frac {i f \operatorname {polylog}\left (2, -i {\mathrm e}^{d x +c}\right )}{2 a \,d^{2}}-\frac {f c \arctan \left ({\mathrm e}^{d x +c}\right )}{d^{2} a}\) \(218\)

[In]

int((f*x+e)*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

(d*f*x*exp(d*x+c)+d*e*exp(d*x+c)+f*exp(d*x+c)-I*f)/(exp(d*x+c)-I)^2/d^2/a+1/d/a*e*arctan(exp(d*x+c))+1/2*I/d/a
*f*ln(1-I*exp(d*x+c))*x+1/2*I/d^2/a*f*ln(1-I*exp(d*x+c))*c+1/2*I*f*polylog(2,I*exp(d*x+c))/a/d^2-1/2*I/d/a*f*l
n(1+I*exp(d*x+c))*x-1/2*I/d^2/a*f*ln(1+I*exp(d*x+c))*c-1/2*I*f*polylog(2,-I*exp(d*x+c))/a/d^2-1/d^2/a*f*c*arct
an(exp(d*x+c))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 352 vs. \(2 (135) = 270\).

Time = 0.25 (sec) , antiderivative size = 352, normalized size of antiderivative = 2.19 \[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\frac {{\left (i \, f e^{\left (2 \, d x + 2 \, c\right )} + 2 \, f e^{\left (d x + c\right )} - i \, f\right )} {\rm Li}_2\left (i \, e^{\left (d x + c\right )}\right ) + {\left (-i \, f e^{\left (2 \, d x + 2 \, c\right )} - 2 \, f e^{\left (d x + c\right )} + i \, f\right )} {\rm Li}_2\left (-i \, e^{\left (d x + c\right )}\right ) + 2 \, {\left (d f x + d e + f\right )} e^{\left (d x + c\right )} + {\left (-i \, d e + i \, c f + {\left (i \, d e - i \, c f\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d e - c f\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} + i\right ) + {\left (i \, d e - i \, c f + {\left (-i \, d e + i \, c f\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (d e - c f\right )} e^{\left (d x + c\right )}\right )} \log \left (e^{\left (d x + c\right )} - i\right ) + {\left (i \, d f x + i \, c f + {\left (-i \, d f x - i \, c f\right )} e^{\left (2 \, d x + 2 \, c\right )} - 2 \, {\left (d f x + c f\right )} e^{\left (d x + c\right )}\right )} \log \left (i \, e^{\left (d x + c\right )} + 1\right ) + {\left (-i \, d f x - i \, c f + {\left (i \, d f x + i \, c f\right )} e^{\left (2 \, d x + 2 \, c\right )} + 2 \, {\left (d f x + c f\right )} e^{\left (d x + c\right )}\right )} \log \left (-i \, e^{\left (d x + c\right )} + 1\right ) - 2 i \, f}{2 \, {\left (a d^{2} e^{\left (2 \, d x + 2 \, c\right )} - 2 i \, a d^{2} e^{\left (d x + c\right )} - a d^{2}\right )}} \]

[In]

integrate((f*x+e)*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x, algorithm="fricas")

[Out]

1/2*((I*f*e^(2*d*x + 2*c) + 2*f*e^(d*x + c) - I*f)*dilog(I*e^(d*x + c)) + (-I*f*e^(2*d*x + 2*c) - 2*f*e^(d*x +
 c) + I*f)*dilog(-I*e^(d*x + c)) + 2*(d*f*x + d*e + f)*e^(d*x + c) + (-I*d*e + I*c*f + (I*d*e - I*c*f)*e^(2*d*
x + 2*c) + 2*(d*e - c*f)*e^(d*x + c))*log(e^(d*x + c) + I) + (I*d*e - I*c*f + (-I*d*e + I*c*f)*e^(2*d*x + 2*c)
 - 2*(d*e - c*f)*e^(d*x + c))*log(e^(d*x + c) - I) + (I*d*f*x + I*c*f + (-I*d*f*x - I*c*f)*e^(2*d*x + 2*c) - 2
*(d*f*x + c*f)*e^(d*x + c))*log(I*e^(d*x + c) + 1) + (-I*d*f*x - I*c*f + (I*d*f*x + I*c*f)*e^(2*d*x + 2*c) + 2
*(d*f*x + c*f)*e^(d*x + c))*log(-I*e^(d*x + c) + 1) - 2*I*f)/(a*d^2*e^(2*d*x + 2*c) - 2*I*a*d^2*e^(d*x + c) -
a*d^2)

Sympy [F]

\[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=- \frac {i \left (\int \frac {e \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx + \int \frac {f x \operatorname {sech}{\left (c + d x \right )}}{\sinh {\left (c + d x \right )} - i}\, dx\right )}{a} \]

[In]

integrate((f*x+e)*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x)

[Out]

-I*(Integral(e*sech(c + d*x)/(sinh(c + d*x) - I), x) + Integral(f*x*sech(c + d*x)/(sinh(c + d*x) - I), x))/a

Maxima [F]

\[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )} \operatorname {sech}\left (d x + c\right )}{i \, a \sinh \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((f*x+e)*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x, algorithm="maxima")

[Out]

f*(((d*x*e^c + e^c)*e^(d*x) - I)/(a*d^2*e^(2*d*x + 2*c) - 2*I*a*d^2*e^(d*x + c) - a*d^2) + 2*integrate(1/4*x/(
a*e^(d*x + c) + I*a), x) + 2*integrate(1/4*x/(a*e^(d*x + c) - I*a), x)) - 1/2*e*(4*e^(-d*x - c)/((4*I*a*e^(-d*
x - c) + 2*a*e^(-2*d*x - 2*c) - 2*a)*d) + I*log(e^(-d*x - c) + I)/(a*d) - I*log(I*e^(-d*x - c) + 1)/(a*d))

Giac [F]

\[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int { \frac {{\left (f x + e\right )} \operatorname {sech}\left (d x + c\right )}{i \, a \sinh \left (d x + c\right ) + a} \,d x } \]

[In]

integrate((f*x+e)*sech(d*x+c)/(a+I*a*sinh(d*x+c)),x, algorithm="giac")

[Out]

integrate((f*x + e)*sech(d*x + c)/(I*a*sinh(d*x + c) + a), x)

Mupad [F(-1)]

Timed out. \[ \int \frac {(e+f x) \text {sech}(c+d x)}{a+i a \sinh (c+d x)} \, dx=\int \frac {e+f\,x}{\mathrm {cosh}\left (c+d\,x\right )\,\left (a+a\,\mathrm {sinh}\left (c+d\,x\right )\,1{}\mathrm {i}\right )} \,d x \]

[In]

int((e + f*x)/(cosh(c + d*x)*(a + a*sinh(c + d*x)*1i)),x)

[Out]

int((e + f*x)/(cosh(c + d*x)*(a + a*sinh(c + d*x)*1i)), x)